# 作者: 赵炳森
# 2025年11月16日01时37分37秒
# 2215031808@qq.com
import re
def use_greedy():
    s = "This is a number 234-235-22-423"
    ret = re.match(r".+?(\d+-\d+-\d+-\d+)", s)
    print(ret.group(1))
    print(re.match(r"aa(\d+)", "aa2343ddd").group(1))
    '2343'
    print(re.match(r"aa(\d+?)", "aa2343ddd").group(1))
    '2'
    print(re.match(r"aa(\d+)ddd", "aa2343ddd").group(1))
    '2343'
    print(re.match(r"aa(\d+?)ddd", "aa2343ddd").group(1))
    '2343'

def use_r():
    mm = "c:\\a\\b\\c"
    print(mm)
    print(re.match(r"c:\\", mm).group())

def use_option():
    print(re.match(r'\w*','abc函',flags=re.A).group())
    print(re.match(r'a*','aA',flags=re.I).group())
    print(re.match(r'.*', 'abc\ndef', flags=re.S).group())
if __name__ == '__main__':
    # use_greedy()
    # use_r()
    use_option()